//
//  GuideViewController.m
//  Movie
//
//  Created by tengyang on 15/7/27.
//  Copyright (c) 2015年 tengyang. All rights reserved.
//

#import "GuideViewController.h"
#import "common.h"
#import "LaunchViewController.h"

@interface GuideViewController ()

@end

@implementation GuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self _createGuideImage];
    
    
    
    
    
}

- (void)_createGuideImage
{
    UIScrollView *scrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
    scrollView.contentSize=CGSizeMake(kWidth*5, kHeight);
    scrollView.pagingEnabled=YES;
    for (int i=0; i<5; i++) {
        UIImageView *image1=[[UIImageView alloc]initWithFrame:CGRectMake(kWidth*i, 0, kWidth, kHeight)];
        
        image1.image=[UIImage imageNamed:[NSString stringWithFormat:@"guide%d@2x.png",i+1]];
        [scrollView addSubview:image1];
        
        UIImageView *image2=[[UIImageView alloc]initWithFrame:CGRectMake(i*kWidth+110, kHeight-60, 150, 40)];
        image2.image=[UIImage imageNamed:[NSString stringWithFormat:@"guideProgress%d@2x.png",i+1]];
        [scrollView addSubview:image2];
        
    }
    
    UIButton *button=[[UIButton alloc]initWithFrame:CGRectMake(kWidth*4+150, kHeight-100, 80, 40)];
    [button setTitle:@"点此进入" forState:UIControlStateNormal];
    [button setTintColor:[UIColor orangeColor]];
    [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [scrollView addSubview:button];
    
    [self.view addSubview:scrollView];
}

- (void)buttonAction
{
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.3];
    LaunchViewController *vc=[[LaunchViewController alloc]init];
    self.view.window.rootViewController=vc;
    [UIView commitAnimations];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
